import { Global, Module } from '@nestjs/common';
import { UserController } from './user.controller';
import { UserRepository } from './user.repository';
import { UserTypeormRepository } from './repository/user.typeorm.repository';
import { UserPrismaRepository } from './repository/user.prisma.repository';
import { UserMongooseRepository } from './repository/user.mongoose.repository';
import { TypeOrmModule } from '@nestjs/typeorm';
// import { MongooseModule } from '@nestjs/mongoose';
import { UserSchema } from './user.schema';
import { TYPEORM_DATABASE } from '@/database/database.constants';
import { User } from './user.entity';
import { MongooseModule } from '@/database/mongoose/mongoose.module';
import { RoleModule } from '@/role/role.module';
import { PolicyModule } from '@/policy/policy.module';
import { PermissionModule } from '@/permission/permission.module';
@Global()
@Module({
  imports: [
    TypeOrmModule.forFeature([User], TYPEORM_DATABASE),
    MongooseModule.forFeature([{ name: 'User', schema: UserSchema }]),
    RoleModule,
    PolicyModule,
    PermissionModule,
  ],
  controllers: [UserController],
  providers: [
    UserTypeormRepository,
    UserPrismaRepository,
    UserMongooseRepository,
    UserRepository,
  ],
  exports: [UserRepository],
})
export class UserModule {}
